package Thread;

public class demon {
    public void merge(int[] nums1, int m, int[] nums2, int n) {
        int len1 = m-1;
        int len2 = n-1;
        int i = m+n-1;
        while(len1 >= 0 && len2 >= 0 && i>=0)
        {
            nums1[i--] = nums1[len1]>nums2[len2]? nums1[len1--]:nums2[len2--];
        }
        System.arraycopy(nums2,0,nums1,0,len2+1);
    }
}
